package adv3;

import java.util.Scanner;

public class PanDuan {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("文件名:");
		String fileName = sc.next();
		// fileName.contains(".java")//不合适

		if (fileName.endsWith(".java")) {
			System.out.println("合法");
		} else {
			System.out.println("不合法");
		}
		// @ .
		System.out.println("email:");
		String email = sc.next();
		int pos1 = email.indexOf('@');
		int pos2 = email.indexOf('.');
		if (pos1 > 0 && pos2 > pos1) {
			System.out.println("勉强合法");
		} else {
			System.out.println("邮箱非法");
		}
	}

}
